package j05;

import java.util.Scanner;

public class J05_Expression39 {

	public static void main(String[] args) {
//		Scanner input=null;
//		input= new Scanner(System.in);
//		
//		int sum=0;
//		int number=input.nextInt();
//		while (number !=0){
//			sum+=number;
//			number = input.nextInt();
//		}

		Scanner input=null;
		input= new Scanner(System.in);
		
		int sum=0;
		int number=input.nextInt();
		do{
			sum+=number;
			number = input.nextInt();
		}while(number !=0);
	}

}
